using System;
using System.Collections;

namespace monoServer
{
	public class TableConnector : ConnectorBase
	{
		private string tableid;
		public string tableID
		{
			get {
				return this.tableid;
			}
			set {
				this.tableid = value;
			}
		}
		
		private ArrayList _columns;
		public ArrayList columns {
			get {
				return this._columns;
			}
			set {
				this._columns = value;
			}
		}
		
		private BugTable bt;
		public BugTable table {
			get {
				return this.bt;
			}
			set {
				this.bt = value;
			}
		}
		
		public TableConnector (CommunicatorParallel c, ulong id) : base(c, id)
		{
		}
		
		public void process(Telegram t)
		{
		}
		
		public void sendRow(ArrayList row)
		{
			//Telegram t = new Telegram("BUGTABLE",Telegram.CONNECTOR, this.c.dm.currentTelegramKey);
			//t.addParameter(this.tableid);
			Telegram t = Telegram.getConnector(this.c.dm.currentTelegramKey, this.c.dm.currentConnectorKey, "SENDROW");
			for(int i=0; i<=row.Count-1; i++)
			{
				object o = row[i];
				t.addParameter(o.ToString());
			}
			this.c.sendTelegram(t);
		}
		
		public void addRow(Telegram t)
		{
			this.bt.addRow(t.getParamsAsString());
		}
	}
}

